﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Public.Common;

public partial class tags : System.Web.UI.Page
{
    public string temp_tagname = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int tagid = MRequest.GetQueryInt("tagid", 0);
            int page = MRequest.GetQueryInt("page", 1);
            int count = MRequest.GetQueryInt("count", 0);
            if (tagid != 0)
                ShowData(tagid, page, count);
        }
    }

    protected void ShowData(int tagid, int page, int count)
    {
        Forum.Entities.forum_tagsinfo model = WebBase.CacheRepository.forum_tags.GetByTagId(tagid);
        if (model != null)
        {
            temp_tagname = model.Tag_Name;
            //this.Title = temp_tagname;

            string where = " TagsRelation_TagID=" + model.Tag_ID;

            count = count == 0 ? WebBase.Repository.getbodytag.GetCount(where) : count;
            this.Repeater2.DataSource = WebBase.Repository.getbodytag.GetPaged(where, " body_id desc ", page == 0 ? 0 : page - 1, 20);
            this.Repeater2.DataBind();

            Public.AspNetPage page_ = new Public.AspNetPage(count, page, 2, 20);
            page_.URLTYPE = Public.AspNetPageInfo.URLType.Aspx;
            this.pagelisthtml.InnerHtml = page_.GetPages();

        }
    }
}